home *** CD-ROM | disk | FTP | other *** search
- //****************************************************************//
- // Filename: Bar.h
- // Autor: Christian Taulien of Strange Intelligence
- // Purpose: Definition of Bar management classes for FreshBar
- // Creation: 17. Mai 1998
- //****************************************************************//
- #ifndef TAULIEN_BAR_H
- #define TAULIEN_BAR_H
-
- #include <exec/types.h>
- #include <exec/nodes.h>
- #include <exec/lists.h>
-
- #include "global.h"
- #include "SIFC_Strings.h"
-
- class BarListC;
- class BarWindowNodeC;
- class TextMeasureC;
-
- //*************************************************************************//
- //.klasse
- //KLASSENNAME : BarNodeC
- //VERSION : 17. Mai 1998
- //AUTOR : Taulien
- //AUFGABE : Eine Klasse zur Verwaltung eines Balkens (ProgressBar)
- //DOKUMENTATION : -
- //BEMERKUNGEN : -
- //AENDERUNGEN : -
- //*************************************************************************//
- class BarNodeC : public struct Node
- {
- friend class BarListC;
-
- public:
- enum ProgressMode
- {
- PM_None,
- PM_Percent,
- PM_Absolute
- };
-
- private:
- // ## datamembers ##
- StringC m_oName;
- ULONG m_ulID;
- ULONG m_ulMaxValue;
- ULONG m_ulCurrentValue;
- BOOL m_bShowPercent;
- int m_iPen;
- int m_iBPen;
- ProgressMode m_eProgressMode;
-
- static ULONG m_ulNextFreeID;
-
- // ## methods
- BarNodeC(BarListC *arg_poBarList, char *arg_sName, ULONG arg_ulMaxValue=100);
- void drawBar(BarWindowNodeC *arg_poBWNode,
- TextMeasureC *arg_poTeMe,
- ULONG arg_ulPosX,
- ULONG arg_ulPosY,
- ULONG arg_ulBarBreite,
- ULONG arg_ulBreite,
- ULONG arg_ulHoehe);
-
- void fillBar(struct RastPort *arg_poRPort,
- TextMeasureC *arg_poTeMe,
- ULONG arg_ulPosX,
- ULONG arg_ulPosY,
- ULONG arg_ulBarBreite,
- ULONG arg_ulBreite,
- ULONG arg_ulHoehe);
- public:
- // ## datamembers
-
- // ## methods
- ~BarNodeC();
-
- StringC getName(void) { return m_oName; }
- ULONG getBarID() { return m_ulID; }
- void setMaxVal(ULONG arg_ulValue)
- { m_ulMaxValue = arg_ulValue; }
- void setCurrentVal(ULONG arg_ulValue)
- { m_ulCurrentValue = arg_ulValue; }
- void setProgressMode(ProgressMode arg_eMode)
- { m_eProgressMode = arg_eMode; }
- void setFillPen(int arg_iFillPen)
- { m_iPen = arg_iFillPen; }
- void setBackPen(int arg_iBackPen)
- { m_iBPen = arg_iBackPen; }
- BarNodeC *getNext(void);
- BarNodeC *getPrev(void);
- };
-
- //*************************************************************************//
- //.klasse
- //KLASSENNAME : BarListC
- //VERSION : 17. Mai 1998
- //AUTOR : Taulien
- //AUFGABE : Eine Klasse für die Verwaltung von verschiedenen Balken
- //DOKUMENTATION : -
- //BEMERKUNGEN : -
- //AENDERUNGEN : -
- //*************************************************************************//
- class BarListC : public struct List
- {
- private:
- // ## private datamembers ##
- int m_iBarWidth;
-
- public:
- BarListC();
- ~BarListC();
-
- BarNodeC *addBar(char *arg_sName, ULONG arg_ulMaxValue = 100);
- void removeBar(ULONG arg_ulBarID);
- void removeAll();
-
- BarNodeC *findBarNode(ULONG arg_ulBarID);
- BarNodeC *getFirst() { return (BarNodeC *) lh_Head; }
- int indexOf(BarNodeC *arg_poNode);
- int getSize();
-
- BarNodeC *operator[](int arg_iIndex);
-
- int getBarWidth() { return m_iBarWidth; }
- void setBarWidth(int arg_iBarWidth) { m_iBarWidth = arg_iBarWidth; }
- int getHeight(struct Screen *arg_poScreen);
- int getWidth(struct Screen *arg_poScreen);
- int getBarTitleWidth(struct Screen *arg_poScreen);
- void drawBars(BarWindowNodeC *arg_poBWNode, ULONG arg_ulPosX, ULONG arg_ulPosY);
- void fillBars(BarWindowNodeC *arg_poBWNode, ULONG arg_ulPosX, ULONG arg_ulPosY);
- };
-
- #endif // TAULIEN_BAR_H
-
-